/*
* SMILParser
*
* Version 1.0
*
* Programmers: Jesse Louderback, Noah Pham, Chad Carpenter, and Marc Hindman
*/
package Message;

public class SMILRegion {
	private String id;
	private float x;
	private float y;
	private float height;
	private float width;
	private boolean visible = false;

	public SMILRegion(String id, float x, float y, float height, float width) {
		setId(id);
		setX(x);
		setY(y);
		setHeight(height);
		setWidth(width);
	}

	public void changeSize(float deltaX, float deltaY) {
		if (width - deltaX != 0) {
			width += deltaX;
		}
		if (height - deltaY != 0) {
			height += deltaY;
		}
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public float getHeight() {
		return height;
	}

	public void setHeight(float height) {
		this.height = height;
	}

	public float getWidth() {
		return width;
	}

	public void setWidth(float width) {
		this.width = width;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public void move(float dx, float dy) {
		x += dx;
		y += dy;
	}

	@Override
	public String toString() {
		return "<region id=\"" + id + "\" width=\"" + width + "\" height=\""
				+ height + "\" left=\"" + x + "\" top=\"" + y + "\" />";
	}
}
